#include "asynlog.h"
#include "asynlogImpl.h"
#include "asynlogger.h"
#include <assert.h>
#include <chrono>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <filesystem>
#include "libmyutil/myutil.h"

using namespace std;

namespace asynlog {
    bool SetLogConfig(const LogConfig& config) {
        return LogImpl::Get()->SetLogConfig(config);
    }
    bool SetLogFile(const std::wstring& sFile, LOG_TYPE type) {
        return LogImpl::Get()->SetLogFile(sFile, type);
    }
    bool SetLogLevel(LOG_LEVEL level, LOG_TYPE type) {
        return LogImpl::Get()->SetLogLevel(level, type);
    }
    LOG_LEVEL GetLogLevel(LOG_TYPE type) {
        return LogImpl::Get()->GetLogLevel(type);
    }
    std::wstring GetLogFile(LOG_TYPE type) {
        return LogImpl::Get()->GetLogFile(type);
    }

    void CloseAllLog() {
        LogImpl::Get()->CloseAllLog();
    }

    Logger& LogImpl(LOG_TYPE type, LOG_LEVEL level, const char* _file_, int _line_, const char* fmt) {
        return LogImpl::Get()->GetLogger(type)->DoLog(level, _file_, _line_, fmt);
    }

}   //asynlog
